module.exports = {
    port: 1000,
    IPv4: 'localhost',
    agentSev: 'http://192.168.2.12:8501', //随寻通内网地址
    // agentSev: 'http://192.168.2.12:8800',//随寻通线上地址
    // agentSev: 'http://192.168.2.25:8080',//陈显强地址
    agentSevUploadPic: 'http://192.168.2.12:8800',//图片上传地址
    getAgent: function() {
        return {
            '/operator/*': {
                target: this.agentSev
            },
            '/exec/*': {
                target: this.agentSev
            },
            '/banner/*': {
                target: this.agentSev
            },
            '/newsCenter/*': {
                target: this.agentSev
            },
            '/cooperationPolicy/*': {
                target: this.agentSev
            },
            '/cooperationPartner/*': {
                target: this.agentSev
            },
            '/caseDisplay/*': {
                target: this.agentSev
            },
            '/upload/*': {
                target: this.agentSevUploadPic
            },
            '/instructions/*': {
                target: this.agentSev
            }

        }
    },
    getIP: function() {
        try {
            const network = require('os').networkInterfaces()
            this.IPv4 = network[Object.keys(network)[0]][1].address
        } catch (e) {
            this.IPv4 = '127.0.0.1';
        } finally {
            const httpStr = 'http://' + this.IPv4 + ':' + this.port;
            const opn = require('opn');
            setTimeout(function() {
                opn(httpStr);
            }, 20000);
            return this.IPv4;
        }
    }
}
